<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <p>{{msg}}</p>
      <button @click="msg=msg+1">按钮</button>
    </div>

    <script src="./vue.js"></script>

    <script>
      const vm = new Vue({
        el: '#app',
        data: {
          msg: 'hello directives',
        },
        // template的内容会把el所绑定的模板的内容覆盖掉
        template: `
          <div>
            <h1>{{msg}}</h1>
            <button @click="msg=msg+1">template按钮</button>
          </div>
        `,
      })
    </script>
  </body>
</html>
